﻿<%@ WebHandler Language="C#" Class="Ajaxtest" %>

using System;
using System.Web;

public class Ajaxtest : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
        if(context.Request.RequestType=="POST")
            post(context.Request, context.Response);
        else
            get(context.Request,context.Response);
    }
    
    private void get(HttpRequest request,HttpResponse response){
        response.Write("Hello Get!");
    }

    private void post(HttpRequest request, HttpResponse response)
    {
        response.Write("Hello Post " + request.Params["answer"].ToString() + " !" + request.Params["type"].ToString());
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}